package com.cfec.ipoth_service.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 系统老人基础信息表，存储老人基本资料和账户状态
 * @TableName tb_olders
 */
@TableName(value ="tb_olders")
@Data
public class TbOlders {
    /**
     * 用户唯一标识符
     */
    @TableId(type = IdType.AUTO)
    private Long olderId;

    /**
     * 老人姓名
     */
    private String olderName;

    /**
     * 老人家庭住址
     */
    private String olderAddress;

    /**
     * 性别(M-男/F-女/O-其他)
     */
    private String gender;

    /**
     * 出生日期，用于年龄相关分析
     */
    private Date birthDate;

    /**
     * 联系电话
     */
    private String contactPhone;

    /**
     * 紧急联系人姓名
     */
    private String emergencyContact;

    /**
     * 紧急联系电话
     */
    private String emergencyPhone;

    /**
     * 注册时间
     */
    private Date registrationDate;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 状态(1使用，0弃用)
     */
    private Long olderStatus;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbOlders other = (TbOlders) that;
        return (this.getOlderId() == null ? other.getOlderId() == null : this.getOlderId().equals(other.getOlderId()))
            && (this.getOlderName() == null ? other.getOlderName() == null : this.getOlderName().equals(other.getOlderName()))
            && (this.getOlderAddress() == null ? other.getOlderAddress() == null : this.getOlderAddress().equals(other.getOlderAddress()))
            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
            && (this.getBirthDate() == null ? other.getBirthDate() == null : this.getBirthDate().equals(other.getBirthDate()))
            && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
            && (this.getEmergencyContact() == null ? other.getEmergencyContact() == null : this.getEmergencyContact().equals(other.getEmergencyContact()))
            && (this.getEmergencyPhone() == null ? other.getEmergencyPhone() == null : this.getEmergencyPhone().equals(other.getEmergencyPhone()))
            && (this.getRegistrationDate() == null ? other.getRegistrationDate() == null : this.getRegistrationDate().equals(other.getRegistrationDate()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getOlderStatus() == null ? other.getOlderStatus() == null : this.getOlderStatus().equals(other.getOlderStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOlderId() == null) ? 0 : getOlderId().hashCode());
        result = prime * result + ((getOlderName() == null) ? 0 : getOlderName().hashCode());
        result = prime * result + ((getOlderAddress() == null) ? 0 : getOlderAddress().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getBirthDate() == null) ? 0 : getBirthDate().hashCode());
        result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
        result = prime * result + ((getEmergencyContact() == null) ? 0 : getEmergencyContact().hashCode());
        result = prime * result + ((getEmergencyPhone() == null) ? 0 : getEmergencyPhone().hashCode());
        result = prime * result + ((getRegistrationDate() == null) ? 0 : getRegistrationDate().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getOlderStatus() == null) ? 0 : getOlderStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", olderId=").append(olderId);
        sb.append(", olderName=").append(olderName);
        sb.append(", olderAddress=").append(olderAddress);
        sb.append(", gender=").append(gender);
        sb.append(", birthDate=").append(birthDate);
        sb.append(", contactPhone=").append(contactPhone);
        sb.append(", emergencyContact=").append(emergencyContact);
        sb.append(", emergencyPhone=").append(emergencyPhone);
        sb.append(", registrationDate=").append(registrationDate);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", olderStatus=").append(olderStatus);
        sb.append("]");
        return sb.toString();
    }
}